<template>
    <div class="single">
        <router-link :to="{name: 'details', params:{ id:item.id }}"><h3>{{ item.title }}</h3></router-link>
        <p>{{ item.content }}</p>
        <span class="tags" v-for="tag in item.tags" :key="tag">{{ tag }}</span>
        <button @click="Single()">删除</button>
    </div>
</template>

<script setup>
defineProps({
    item:Object
});

</script>

<style scoped>
.single{
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.single h3{
    line-height:1.5;
    background-color:antiquewhite;
    height: 30px;
}
.single span{
    margin-right: 10px;
}
.tags{
    margin-top: 10px;
}
</style>